<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: ActionController::Integration::Session</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">ActionController::Integration::Session</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/rails/actionpack/lib/action_controller/integration_rb.html">
                vendor/rails/actionpack/lib/action_controller/integration.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
An integration <a href="Session.html">Session</a> instance represents a set
of requests and responses performed sequentially by some virtual user.
Becase you can instantiate multiple sessions and run them side-by-side, you
can also mimic (to some limited extent) multiple simultaneous users
interacting with your system.
</p>
<p>
Typically, you will instantiate a <a href="Session.html#M000233">new</a>
session using IntegrationTest#open_session, rather than instantiating <a
href="Session.html">Integration::Session</a> directly.
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000248">delete</a>&nbsp;&nbsp;
      <a href="#M000243">delete_via_redirect</a>&nbsp;&nbsp;
      <a href="#M000238">follow_redirect!</a>&nbsp;&nbsp;
      <a href="#M000245">get</a>&nbsp;&nbsp;
      <a href="#M000240">get_via_redirect</a>&nbsp;&nbsp;
      <a href="#M000249">head</a>&nbsp;&nbsp;
      <a href="#M000237">host!</a>&nbsp;&nbsp;
      <a href="#M000235">https!</a>&nbsp;&nbsp;
      <a href="#M000236">https?</a>&nbsp;&nbsp;
      <a href="#M000233">new</a>&nbsp;&nbsp;
      <a href="#M000246">post</a>&nbsp;&nbsp;
      <a href="#M000241">post_via_redirect</a>&nbsp;&nbsp;
      <a href="#M000247">put</a>&nbsp;&nbsp;
      <a href="#M000242">put_via_redirect</a>&nbsp;&nbsp;
      <a href="#M000244">redirect?</a>&nbsp;&nbsp;
      <a href="#M000239">request_via_redirect</a>&nbsp;&nbsp;
      <a href="#M000234">reset!</a>&nbsp;&nbsp;
      <a href="#M000252">url_for</a>&nbsp;&nbsp;
      <a href="#M000251">xhr</a>&nbsp;&nbsp;
      <a href="#M000250">xml_http_request</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->
    <div id="includes">
      <h3 class="section-bar">Included Modules</h3>

      <div id="includes-list">
        <span class="include-name">Test::Unit::Assertions</span>
        <span class="include-name"><a href="../Assertions.html">ActionController::Assertions</a></span>
        <span class="include-name"><a href="../TestProcess.html">ActionController::TestProcess</a></span>
        <span class="include-name">ControllerCapture</span>
      </div>
    </div>

    <div id="section">





    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">accept</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc">
The Accept header to send.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">controller</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc">
A reference to the controller instance used by the last request.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">cookies</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc">
A map of the cookies returned by the last response, and which will be sent
with the next request.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">headers</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc">
A map of the headers returned by the last response.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">host</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc">
The hostname used in the last request.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">path</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc">
The URI of the last request.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">remote_addr</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc">
The remote_addr used in the last request.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">request</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc">
A reference to the request instance used by the last request.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">request_count</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc">
A running counter of the number of requests processed.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">response</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc">
A reference to the response instance used by the last request.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">status</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc">
The integer HTTP status code of the last request.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">status_message</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc">
The status message that accompanied the status code of the last request.

</td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000233" class="method-detail">
        <a name="M000233"></a>

        <div class="method-heading">
          <a href="#M000233" class="method-signature">
          <span class="method-name">new</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Create and initialize a <a href="Session.html#M000233">new</a> <tt><a
href="Session.html">Session</a></tt> instance.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000233-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000233-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 58</span>
58:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
59:         <span class="ruby-identifier">reset!</span>
60:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000248" class="method-detail">
        <a name="M000248"></a>

        <div class="method-heading">
          <a href="#M000248" class="method-signature">
          <span class="method-name">delete</span><span class="method-args">(path, parameters = nil, headers = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Performs a DELETE request with the given parameters. See <a
href="Session.html#M000245">get</a>() for more details.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000248-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000248-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 186</span>
186:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">headers</span> = <span class="ruby-keyword kw">nil</span>)
187:         <span class="ruby-identifier">process</span> <span class="ruby-identifier">:delete</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span>, <span class="ruby-identifier">headers</span>
188:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000243" class="method-detail">
        <a name="M000243"></a>

        <div class="method-heading">
          <a href="#M000243" class="method-signature">
          <span class="method-name">delete_via_redirect</span><span class="method-args">(path, parameters = nil, headers = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Performs a DELETE request, following any subsequent redirect. See <a
href="Session.html#M000239">request_via_redirect</a>() for more
information.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000243-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000243-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 154</span>
154:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete_via_redirect</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">headers</span> = <span class="ruby-keyword kw">nil</span>)
155:         <span class="ruby-identifier">request_via_redirect</span>(<span class="ruby-identifier">:delete</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span>, <span class="ruby-identifier">headers</span>)
156:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000238" class="method-detail">
        <a name="M000238"></a>

        <div class="method-heading">
          <a href="#M000238" class="method-signature">
          <span class="method-name">follow_redirect!</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Follow a single redirect response. If the last response was not a redirect,
an exception will be raised. Otherwise, the redirect is performed on the
location header.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000238-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000238-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 118</span>
118:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">follow_redirect!</span>
119:         <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;not a redirect! #{@status} #{@status_message}&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">redirect?</span>
120:         <span class="ruby-identifier">get</span>(<span class="ruby-identifier">interpret_uri</span>(<span class="ruby-identifier">headers</span>[<span class="ruby-value str">'location'</span>].<span class="ruby-identifier">first</span>))
121:         <span class="ruby-identifier">status</span>
122:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000245" class="method-detail">
        <a name="M000245"></a>

        <div class="method-heading">
          <a href="#M000245" class="method-signature">
          <span class="method-name">get</span><span class="method-args">(path, parameters = nil, headers = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Performs a GET request with the given parameters. The parameters may be
<tt>nil</tt>, a Hash, or a string that is appropriately encoded
(application/x-www-form-urlencoded or multipart/form-data). The headers
should be a hash. The keys will automatically be upcased, with the prefix
&#8216;HTTP_&#8217; added if needed.
</p>
<p>
You can also perform POST, PUT, DELETE, and HEAD requests with <a
href="Session.html#M000246">post</a>, <a
href="Session.html#M000247">put</a>, <a
href="Session.html#M000248">delete</a>, and <a
href="Session.html#M000249">head</a>.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000245-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000245-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 171</span>
171:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">headers</span> = <span class="ruby-keyword kw">nil</span>)
172:         <span class="ruby-identifier">process</span> <span class="ruby-identifier">:get</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span>, <span class="ruby-identifier">headers</span>
173:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000240" class="method-detail">
        <a name="M000240"></a>

        <div class="method-heading">
          <a href="#M000240" class="method-signature">
          <span class="method-name">get_via_redirect</span><span class="method-args">(path, parameters = nil, headers = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Performs a GET request, following any subsequent redirect. See <a
href="Session.html#M000239">request_via_redirect</a>() for more
information.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000240-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000240-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 136</span>
136:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_via_redirect</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">headers</span> = <span class="ruby-keyword kw">nil</span>)
137:         <span class="ruby-identifier">request_via_redirect</span>(<span class="ruby-identifier">:get</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span>, <span class="ruby-identifier">headers</span>)
138:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000249" class="method-detail">
        <a name="M000249"></a>

        <div class="method-heading">
          <a href="#M000249" class="method-signature">
          <span class="method-name">head</span><span class="method-args">(path, parameters = nil, headers = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Performs a HEAD request with the given parameters. See <a
href="Session.html#M000245">get</a>() for more details.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000249-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000249-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 191</span>
191:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">head</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">headers</span> = <span class="ruby-keyword kw">nil</span>)
192:         <span class="ruby-identifier">process</span> <span class="ruby-identifier">:head</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span>, <span class="ruby-identifier">headers</span>
193:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000237" class="method-detail">
        <a name="M000237"></a>

        <div class="method-heading">
          <a href="#M000237" class="method-signature">
          <span class="method-name">host!</span><span class="method-args">(name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Set the host name to use in the next request.
</p>
<pre>
  session.host! &quot;www.example.com&quot;
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000237-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000237-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 111</span>
111:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">host!</span>(<span class="ruby-identifier">name</span>)
112:         <span class="ruby-ivar">@host</span> = <span class="ruby-identifier">name</span>
113:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000235" class="method-detail">
        <a name="M000235"></a>

        <div class="method-heading">
          <a href="#M000235" class="method-signature">
          <span class="method-name">https!</span><span class="method-args">(flag=true)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Specify whether or not the session should mimic a secure HTTPS request.
</p>
<pre>
  session.https!
  session.https!(false)
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000235-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000235-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 95</span>
95:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">https!</span>(<span class="ruby-identifier">flag</span>=<span class="ruby-keyword kw">true</span>)
96:         <span class="ruby-ivar">@https</span> = <span class="ruby-identifier">flag</span>
97:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000236" class="method-detail">
        <a name="M000236"></a>

        <div class="method-heading">
          <a href="#M000236" class="method-signature">
          <span class="method-name">https?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Return <tt>true</tt> if the session is mimicing a secure HTTPS request.
</p>
<pre>
  if session.https?
    ...
  end
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000236-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000236-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 104</span>
104:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">https?</span>
105:         <span class="ruby-ivar">@https</span>
106:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000246" class="method-detail">
        <a name="M000246"></a>

        <div class="method-heading">
          <a href="#M000246" class="method-signature">
          <span class="method-name">post</span><span class="method-args">(path, parameters = nil, headers = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Performs a POST request with the given parameters. See <a
href="Session.html#M000245">get</a>() for more details.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000246-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000246-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 176</span>
176:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">post</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">headers</span> = <span class="ruby-keyword kw">nil</span>)
177:         <span class="ruby-identifier">process</span> <span class="ruby-identifier">:post</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span>, <span class="ruby-identifier">headers</span>
178:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000241" class="method-detail">
        <a name="M000241"></a>

        <div class="method-heading">
          <a href="#M000241" class="method-signature">
          <span class="method-name">post_via_redirect</span><span class="method-args">(path, parameters = nil, headers = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Performs a POST request, following any subsequent redirect. See <a
href="Session.html#M000239">request_via_redirect</a>() for more
information.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000241-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000241-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 142</span>
142:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">post_via_redirect</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">headers</span> = <span class="ruby-keyword kw">nil</span>)
143:         <span class="ruby-identifier">request_via_redirect</span>(<span class="ruby-identifier">:post</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span>, <span class="ruby-identifier">headers</span>)
144:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000247" class="method-detail">
        <a name="M000247"></a>

        <div class="method-heading">
          <a href="#M000247" class="method-signature">
          <span class="method-name">put</span><span class="method-args">(path, parameters = nil, headers = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Performs a PUT request with the given parameters. See <a
href="Session.html#M000245">get</a>() for more details.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000247-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000247-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 181</span>
181:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">headers</span> = <span class="ruby-keyword kw">nil</span>)
182:         <span class="ruby-identifier">process</span> <span class="ruby-identifier">:put</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span>, <span class="ruby-identifier">headers</span>
183:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000242" class="method-detail">
        <a name="M000242"></a>

        <div class="method-heading">
          <a href="#M000242" class="method-signature">
          <span class="method-name">put_via_redirect</span><span class="method-args">(path, parameters = nil, headers = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Performs a PUT request, following any subsequent redirect. See <a
href="Session.html#M000239">request_via_redirect</a>() for more
information.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000242-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000242-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 148</span>
148:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put_via_redirect</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">headers</span> = <span class="ruby-keyword kw">nil</span>)
149:         <span class="ruby-identifier">request_via_redirect</span>(<span class="ruby-identifier">:put</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span>, <span class="ruby-identifier">headers</span>)
150:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000244" class="method-detail">
        <a name="M000244"></a>

        <div class="method-heading">
          <a href="#M000244" class="method-signature">
          <span class="method-name">redirect?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns <tt>true</tt> if the last response was a redirect.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000244-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000244-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 159</span>
159:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">redirect?</span>
160:         <span class="ruby-identifier">status</span><span class="ruby-operator">/</span><span class="ruby-value">100</span> <span class="ruby-operator">==</span> <span class="ruby-value">3</span>
161:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000239" class="method-detail">
        <a name="M000239"></a>

        <div class="method-heading">
          <a href="#M000239" class="method-signature">
          <span class="method-name">request_via_redirect</span><span class="method-args">(http_method, path, parameters = nil, headers = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Performs a request using the specified method, following any subsequent
redirect. Note that the redirects are followed until the response is not a
redirect&#8212;this means you may run into an infinite loop if your
redirect loops back to itself.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000239-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000239-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 128</span>
128:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">request_via_redirect</span>(<span class="ruby-identifier">http_method</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">headers</span> = <span class="ruby-keyword kw">nil</span>)
129:         <span class="ruby-identifier">send</span>(<span class="ruby-identifier">http_method</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span>, <span class="ruby-identifier">headers</span>)
130:         <span class="ruby-identifier">follow_redirect!</span> <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">redirect?</span>
131:         <span class="ruby-identifier">status</span>
132:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000234" class="method-detail">
        <a name="M000234"></a>

        <div class="method-heading">
          <a href="#M000234" class="method-signature">
          <span class="method-name">reset!</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Resets the instance. This can be used to reset the state information in an
existing session instance, so it can be used from a clean-slate condition.
</p>
<pre>
  session.reset!
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000234-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000234-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 67</span>
67:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset!</span>
68:         <span class="ruby-ivar">@status</span> = <span class="ruby-ivar">@path</span> = <span class="ruby-ivar">@headers</span> = <span class="ruby-keyword kw">nil</span>
69:         <span class="ruby-ivar">@result</span> = <span class="ruby-ivar">@status_message</span> = <span class="ruby-keyword kw">nil</span>
70:         <span class="ruby-ivar">@https</span> = <span class="ruby-keyword kw">false</span>
71:         <span class="ruby-ivar">@cookies</span> = {}
72:         <span class="ruby-ivar">@controller</span> = <span class="ruby-ivar">@request</span> = <span class="ruby-ivar">@response</span> = <span class="ruby-keyword kw">nil</span>
73:         <span class="ruby-ivar">@request_count</span> = <span class="ruby-value">0</span>
74: 
75:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span>        = <span class="ruby-value str">&quot;www.example.com&quot;</span>
76:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">remote_addr</span> = <span class="ruby-value str">&quot;127.0.0.1&quot;</span>
77:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">accept</span>      = <span class="ruby-value str">&quot;text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5&quot;</span>
78: 
79:         <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">defined?</span> <span class="ruby-ivar">@named_routes_configured</span>
80:           <span class="ruby-comment cmt"># install the named routes in this session instance.</span>
81:           <span class="ruby-identifier">klass</span> = <span class="ruby-keyword kw">class</span><span class="ruby-operator">&lt;&lt;</span><span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>
82:           <span class="ruby-constant">Routing</span><span class="ruby-operator">::</span><span class="ruby-constant">Routes</span>.<span class="ruby-identifier">install_helpers</span>(<span class="ruby-identifier">klass</span>)
83: 
84:           <span class="ruby-comment cmt"># the helpers are made protected by default--we make them public for</span>
85:           <span class="ruby-comment cmt"># easier access during testing and troubleshooting.</span>
86:           <span class="ruby-identifier">klass</span>.<span class="ruby-identifier">module_eval</span> { <span class="ruby-identifier">public</span> <span class="ruby-operator">*</span><span class="ruby-constant">Routing</span><span class="ruby-operator">::</span><span class="ruby-constant">Routes</span>.<span class="ruby-identifier">named_routes</span>.<span class="ruby-identifier">helpers</span> }
87:           <span class="ruby-ivar">@named_routes_configured</span> = <span class="ruby-keyword kw">true</span>
88:         <span class="ruby-keyword kw">end</span>
89:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000252" class="method-detail">
        <a name="M000252"></a>

        <div class="method-heading">
          <a href="#M000252" class="method-signature">
          <span class="method-name">url_for</span><span class="method-args">(options)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the URL for the given options, according to the rules specified in
the application&#8216;s routes.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000252-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000252-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 213</span>
213:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">url_for</span>(<span class="ruby-identifier">options</span>)
214:         <span class="ruby-identifier">controller</span> <span class="ruby-value">? </span><span class="ruby-identifier">controller</span>.<span class="ruby-identifier">url_for</span>(<span class="ruby-identifier">options</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">generic_url_rewriter</span>.<span class="ruby-identifier">rewrite</span>(<span class="ruby-identifier">options</span>)
215:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000251" class="method-detail">
        <a name="M000251"></a>

        <div class="method-heading">
          <span class="method-name">xhr</span><span class="method-args">(request_method, path, parameters = nil, headers = nil)</span>
        </div>
      
        <div class="method-description">
          <p>
Alias for <a href="Session.html#M000250">xml_http_request</a>
</p>
        </div>
      </div>

      <div id="method-M000250" class="method-detail">
        <a name="M000250"></a>

        <div class="method-heading">
          <a href="#M000250" class="method-signature">
          <span class="method-name">xml_http_request</span><span class="method-args">(request_method, path, parameters = nil, headers = nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Performs an XMLHttpRequest request with the given parameters, mirroring a
request from the Prototype library.
</p>
<p>
The request_method is :<a href="Session.html#M000245">get</a>, :<a
href="Session.html#M000246">post</a>, :<a
href="Session.html#M000247">put</a>, :<a
href="Session.html#M000248">delete</a> or :<a
href="Session.html#M000249">head</a>; the parameters are <tt>nil</tt>, a
hash, or a url-encoded or multipart string; the headers are a hash. Keys
are automatically upcased and prefixed with &#8216;HTTP_&#8217; if not
already.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000250-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000250-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_controller/integration.rb, line 202</span>
202:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">xml_http_request</span>(<span class="ruby-identifier">request_method</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">headers</span> = <span class="ruby-keyword kw">nil</span>)
203:         <span class="ruby-identifier">headers</span> <span class="ruby-operator">||=</span> {}
204:         <span class="ruby-identifier">headers</span>[<span class="ruby-value str">'X-Requested-With'</span>] = <span class="ruby-value str">'XMLHttpRequest'</span>
205:         <span class="ruby-identifier">headers</span>[<span class="ruby-value str">'Accept'</span>] <span class="ruby-operator">||=</span> <span class="ruby-value str">'text/javascript, text/html, application/xml, text/xml, */*'</span>
206: 
207:         <span class="ruby-identifier">process</span>(<span class="ruby-identifier">request_method</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">parameters</span>, <span class="ruby-identifier">headers</span>)
208:       <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>